<template>
    <div>
        <button @click="test">孙子按钮</button>
    </div>
</template>

<script>
    export default {
        inject: ['foo'],
        methods:{
            test() {
                console.log(1)
                console.log(this.foo())
            }
        },
    }
</script>

<style scoped>

</style>